In [1]:
import numpy as np
import matplotlib.pyplot as plt
import renksel as re
import noktasal as no
In [2]:
I = plt.imread("../data/cicek.png")

plt.figure()
plt.imshow(I)
plt.show()
No description has been provided for this image
In [3]:
plt.figure(figsize=(10,8))

plt.subplot(2, 2, 1)
J = re.renk_degistirme(I, C=[0.3, 0, 0])
plt.imshow(J)

plt.subplot(2, 2, 2)
J = re.renk_degistirme(I, C=[0.3, 0.3, 0])
plt.imshow(J)

plt.subplot(2, 2, 3)
J = re.renk_degistirme(I, C=[-0.3, -0.3, 0])
plt.imshow(J)

plt.subplot(2, 2, 4)
J = re.renk_degistirme(I, C=[-0.3, -0.3, 0.3])
plt.imshow(J)

plt.show()
No description has been provided for this image
In [4]:
I = plt.imread("../data/cicek.png")[:, :, :3]

plt.figure(figsize=(16,6))

for k in range(7):
    J = re.tek_kanal(I, tur=k)

    plt.subplot(2, 4, k+1)
    plt.imshow(J, plt.cm.gray)


plt.show()
No description has been provided for this image
In [5]:
I = plt.imread("../data/cicek.png")[:, :, :3]

plt.figure(figsize=(12,8))
plt.subplot(2, 2, 1)
plt.imshow(I)

plt.subplot(2, 2, 2)
plt.hist(I.reshape(-1), bins=256, range=(0, 1))
ylim = plt.ylim()

plt.subplot(2, 2, 3)
J = no.parlaklik(I, b=0.3)
plt.imshow(J)

plt.subplot(2, 2, 4)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [6]:
I = plt.imread("../data/cicek.png")[:, :, :3]

plt.figure(figsize=(12,8))
plt.subplot(2, 2, 1)
plt.imshow(I)

plt.subplot(2, 2, 2)
plt.hist(I.reshape(-1), bins=256, range=(0, 1))
ylim = plt.ylim()

plt.subplot(2, 2, 3)
J = no.ayrimlilik(I, a=0.5)
plt.imshow(J)

plt.subplot(2, 2, 4)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [7]:
I = plt.imread("../data/cicek.png")[:, :, :3]

plt.figure(figsize=(16,8))
plt.subplot(2, 3, 1)
plt.imshow(I)

plt.subplot(2, 3, 2)
plt.hist(I.reshape(-1), bins=256, range=(0, 1))
ylim = plt.ylim()

plt.subplot(2, 3, 4)
LUT = no.lut(tur=1)
J = no.yogunluk_donusumu(I, LUT=LUT)
plt.imshow(J)

plt.subplot(2, 3, 5)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.subplot(2, 3, 6)
plt.plot(np.linspace(0, 1, 256), LUT)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.show()
No description has been provided for this image
In [8]:
plt.figure(figsize=(16,4))

plt.subplot(1, 3, 1)
LUT = no.lut(tur=2,a=1.5,b=0)
J = no.yogunluk_donusumu(I, LUT=LUT)
plt.imshow(J)

plt.subplot(1, 3, 2)
plt.plot(np.linspace(0, 1, 256), LUT)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(1, 3, 3)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [9]:
plt.figure(figsize=(16,4))

plt.subplot(1, 3, 1)
LUT = no.lut(tur=2,a=1,b=0.3)
J = no.yogunluk_donusumu(I, LUT=LUT)
plt.imshow(J)

plt.subplot(1, 3, 2)
plt.plot(np.linspace(0, 1, 256), LUT)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(1, 3, 3)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [10]:
plt.figure(figsize=(16,4))

plt.subplot(1, 3, 1)
LUT = no.lut(tur=2,a=1,b=0.3)
J = no.yogunluk_donusumu(I, LUT=LUT)
plt.imshow(J)

plt.subplot(1, 3, 2)
plt.plot(np.linspace(0, 1, 256), LUT)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(1, 3, 3)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [11]:
plt.figure(figsize=(16,4))

plt.subplot(1, 3, 1)
LUT = no.lut(tur=2,a=0.5,b=0)
J = no.yogunluk_donusumu(I, LUT=LUT)
plt.imshow(J)

plt.subplot(1, 3, 2)
plt.plot(np.linspace(0, 1, 256), LUT)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(1, 3, 3)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [12]:
plt.figure(figsize=(16,4))

plt.subplot(1, 3, 1)
LUT = no.lut(tur=3, gamma=1)
J = no.yogunluk_donusumu(I, LUT=LUT)
plt.imshow(J)

plt.subplot(1, 3, 2)
plt.plot(np.linspace(0, 1, 256), LUT)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(1, 3, 3)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [13]:
plt.figure(figsize=(16,4))

plt.subplot(1, 3, 1)
LUT = no.lut(tur=3, gamma=0.5)
J = no.yogunluk_donusumu(I, LUT=LUT)
plt.imshow(J)

plt.subplot(1, 3, 2)
plt.plot(np.linspace(0, 1, 256), LUT)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(1, 3, 3)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [14]:
plt.figure(figsize=(16,4))

plt.subplot(1, 3, 1)
LUT = no.lut(tur=3, gamma=2)
J = no.yogunluk_donusumu(I, LUT=LUT)
plt.imshow(J)

plt.subplot(1, 3, 2)
plt.plot(np.linspace(0, 1, 256), LUT)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(1, 3, 3)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [15]:
plt.figure(figsize=(16,4))

plt.subplot(1, 3, 1)
LUT = no.lut(tur=4, esik=0.5)
J = no.yogunluk_donusumu(I, LUT=LUT)
plt.imshow(J)

plt.subplot(1, 3, 2)
plt.plot(np.linspace(0, 1, 256), LUT)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(1, 3, 3)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [16]:
plt.figure(figsize=(16,3))

plt.subplot(1, 3, 1)
I = plt.imread("../data/rakamlar.png")
plt.imshow(I)

plt.subplot(1, 3, 2)
J = no.gray_scale(I)
plt.imshow(J)

plt.subplot(1, 3, 3)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [17]:
plt.figure(figsize=(16,3))

plt.subplot(1, 2, 1)
LUT = no.lut(tur=4, esik=0.5)
J = no.yogunluk_donusumu(J, LUT=LUT)
plt.imshow(J)

plt.subplot(1, 2, 2)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [18]:
LUT_K = 2

plt.figure(figsize=(12,8))

plt.subplot(2, 2, 1)
I = plt.imread("../data/cicek.png")
plt.imshow(I)

plt.subplot(2, 2, 2)
J = no.basamaklama(I, k=LUT_K)
plt.imshow(J)

plt.subplot(2, 2, 3)
lut = no.lut(tur=5, k=LUT_K)
plt.plot(np.linspace(0, 1, 256), lut)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(2, 2, 4)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [19]:
LUT_K = 4

plt.figure(figsize=(12,8))

plt.subplot(2, 2, 1)
I = plt.imread("../data/cicek.png")
plt.imshow(I)

plt.subplot(2, 2, 2)
J = no.basamaklama(I, k=LUT_K)
plt.imshow(J)

plt.subplot(2, 2, 3)
lut = no.lut(tur=5, k=LUT_K)
plt.plot(np.linspace(0, 1, 256), lut)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(2, 2, 4)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [20]:
LUT_K = 8

plt.figure(figsize=(12,8))

plt.subplot(2, 2, 1)
I = plt.imread("../data/cicek.png")
plt.imshow(I)

plt.subplot(2, 2, 2)
J = no.basamaklama(I, k=LUT_K)
plt.imshow(J)

plt.subplot(2, 2, 3)
lut = no.lut(tur=5, k=LUT_K)
plt.plot(np.linspace(0, 1, 256), lut)
plt.axis([-0.1, 1.1, -0.1, 1.1])
plt.grid(1)

plt.subplot(2, 2, 4)
plt.hist(J.reshape(-1), bins=256, range=(0, 1))
plt.ylim(ylim)

plt.show()
No description has been provided for this image
In [ ]: